package com.mrjoew.weekend.entities.po;

import com.mrjoew.weekend.entities.BasePO;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import org.hibernate.annotations.SQLDelete;

import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;

/**
 * @author Christopher Jones
 * @ClassName PropertiesCarousel
 * @explain 轮播图
 * @date 2020/6/19 0019 11:19
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = false)
@SQLDelete(sql = "UPDATE `properties_carousel` SET deleted = 1 WHERE id = ?")
@Table(name = "properties_carousel")
@Entity
public class PropertiesCarouselPO extends BasePO {

    /**
     * 放置位置
     * 1. 首页
     */
    private Integer position;

    /**
     * 轮播类型
     * 1. 图片链接
     */
    private Integer type;

    /**
     * 备注
     */
    private String remark;

    /**
     * 文件地址
     */
    @OneToOne
    @JoinColumn(name = "file_id", referencedColumnName = "id")
    private SysFilesPO file;
}
